<?php
header("Content-type:text/html;charset=utf8");
header("Access-Control-Allow-Origin:*");
    $name=$_POST["username"];
    $pass=$_POST["userpass"];

    $conn=mysqli_connect("localhost","root","root","my2208");
    if($conn){
        $sql="select * from students where username='$name' and userpass = '$pass'";

        $res=mysqli_query($conn,$sql);
        $num=mysqli_num_rows($res);
        if($num!=0){
            echo "1";
        }else{
            echo "0";
        }
    }else{
        echo "链接失败";
    }
?>